package cn.stylefeng.guns.weixin.carIndustryPlan;

import cn.stylefeng.guns.modular.carIndustryPlan.pojo.request.CarIndustryPlanRequest;
import cn.stylefeng.guns.modular.carIndustryPlan.service.CarIndustryPlanService;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 汽车行业解决方案控制器接口
 *
 * @author liuxue
 * @date 2022/01/10 15:06
 */
@RestController
@ApiResource(name = "汽车行业解决方案接口")
public class CarIndustryPlanWxController {

    @Resource
    private CarIndustryPlanService carIndustryPlanService;


    /**
     * 查看详情
     *
     * @author liuxue
     * @date 2022/01/10 15:06
     */
    @GetResource(name = "查看详情", path = "/wx/carIndustryPlan/detail", requiredPermission = false, requiredLogin = false)
    public ResponseData detail(@Validated(CarIndustryPlanRequest.detail.class) CarIndustryPlanRequest carIndustryPlanRequest) {
        carIndustryPlanRequest.setStatus(1);
        return new SuccessResponseData(carIndustryPlanService.detail(carIndustryPlanRequest));
    }
    /**
     * 获取列表
     *
     * @author liuxue
     * @date 2022/01/10 15:06
     */
    @GetResource(name = "获取列表", path = "/wx/carIndustryPlan/list", requiredPermission = false, requiredLogin = false)
    public ResponseData list(CarIndustryPlanRequest carIndustryPlanRequest) {
        carIndustryPlanRequest.setStatus(1);
        return new SuccessResponseData(carIndustryPlanService.findList(carIndustryPlanRequest));
    }

    /**
     * 获取列表（带分页）
     *
     * @author liuxue
     * @date 2022/01/10 15:06
     */
    @GetResource(name = "分页查询", path = "/wx/carIndustryPlan/page", requiredPermission = false, requiredLogin = false)
    public ResponseData page(CarIndustryPlanRequest carIndustryPlanRequest) {
        carIndustryPlanRequest.setStatus(1);
        return new SuccessResponseData(carIndustryPlanService.findPage(carIndustryPlanRequest));
    }



}